#!/usr/bin/python

import math

def nchoose2(n):
	return n*(n-1)/2;

def euler85():
	target=2000000;
	sqrttarget=math.sqrt(target);	

	values=[];
	x=0;
	while True:
		x+=1;
		values.append( nchoose2(x+1));
		if( values[-1]>target):
			break;

	mindiff=target**2;
	area=0;
	for i in xrange(len(values)):
		m=values[i];
		for j in xrange(len( values)):
			n=values[j];
			if( abs(target-m*n)<mindiff):
				mindiff=abs(target-m*n);
				area=(i+1)*(j+1);

	return area;

		


print euler85();
